#include<iostream>
#include<algorithm>
using namespace std;
const int N = 510;
int arr[N][N];
int fun(int x)
{
	int res = 0;
	for (int i = 1; i <= n; i++) {
		res += arr[x][i];
		res += arr[n - x + 1][i];
	}
	for (int i = x + 1; i <= ; i++) {
		res += arr[i][x];
		res += arr[i][n - x + 1];
	}
	return res;
}
int n;
int main()
{
	int ans = 0;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			cin >> arr[i][j];
		}
	}
	for (int i = 1; i <= n / 2; i++) {
		ans = max(ans, fun(i));
	}
	if (n & 1) {
		ans = max(ans, arr[n / 2 + 1][n / 2 + 1]);
	}
	cout << ans << endl;
	return 0;
}